<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#no {
				position: absolute;
				left: 50px;
				top: 81px;
			}
		</style>
		<script type="text/javascript">
			window.onload=function(){
				var my_yes=document.getElementById("yes");
				var my_no=document.getElementById("no");
				
				//声明一个全局变量 ,初始值为50;
				var left=50;
				
				my_yes.onclick=function(){
					alert("爱我就去把臭袜子洗了");
				}
				my_no.onmouseover=function(){
					left=left+50;
					my_no.style.left=left+"px";
					console.log(my_no);
				}
			}
		</script>
	</head>
	<body>
		<h1>你爱我吗？</h1>
		<input type="button" id="yes" value="爱" />
		<input type="button" id="no" value="不爱" />
	</body>
</html>
